#ifndef CAPTURE_H
#define CAPTURE_H

#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/if_ether.h>
#include <arpa/inet.h>
#include <linux/ip.h>
#include<netinet/tcp.h>
#include <string.h>
#include <pcap.h>
#include <package.h>

class Capture
{
public:
    Capture();
    Capture(char *interface);
    ~Capture();
    void StartCapture();
    void SetInterface(char *interface);
    void CaptureHttpPackage();

private:
    int GetGet(char *data,char *buff);
    int GetUrlPage(char *data,char *buff);
    int IsRealPage(char *data);
    int GetHost(char *data,char *buff);

private:
    bool bCapture;   
    const u_char *packet_content;
    char *net_interface;
    Package cur_package;
};
#endif // CAPTURE_H
